package day04_api_code.com.itheima.d2_stringjoiner;

import java.util.StringJoiner;

public class Test1_StringJoiner {
    public static void main(String[] args) {
        int[] arr = {11, 22, 33, 44};
        System.out.println(getArrayData(arr));
    }
    public static String getArrayData(int[] arr) {
        StringJoiner sj = new StringJoiner(",", "[", "]");
        for (int i = 0; i < arr.length; i++) {
            sj.add(arr[i] + "");
        }
        return sj.toString();
    }
}
